﻿using System;
using System.Data;
using System.Globalization;
using Microsoft.VisualStudio.TestTools.UnitTesting;

#if NET20
namespace System.Net20.Tests
#elif NET35
namespace System.Net35.Tests
#elif NET40
namespace System.Net40.Tests
#elif NET45
namespace System.Net45.Tests
#elif NET451
namespace System.Net451.Tests
#elif PORTABLE40
namespace System.Portable40.Tests
#elif PORTABLE45
namespace System.Portable40.Tests
#endif
{
	[TestClass]
	public class TimeTests
	{
		private static Random Rnd = new Random();
		private TestContext _testContext = null;

		public TestContext TestContext
		{
			get
			{
				return _testContext;
			}
			set
			{
				_testContext = value;
			}
		}

		#region Constructor Tests
		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeSpanConstructorTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target = new Time(data.TimeSpan);
			Assert.AreEqual(data.DateTime.TimeOfDay.Hours, target.TimeSpan.Hours, " [Hours]");
			Assert.AreEqual(data.DateTime.TimeOfDay.Minutes, target.TimeSpan.Minutes, " [Minutes]");
			Assert.AreEqual(data.DateTime.TimeOfDay.Seconds, target.TimeSpan.Seconds, " [Seconds]");
			Assert.AreEqual(data.ShortTimeString, (string)target, " [Time String]");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void DateTimeConstructorTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target = new Time(data.DateTime);
			Assert.AreEqual(data.DateTime.TimeOfDay.Hours, target.TimeSpan.Hours, " [Hours]");
			Assert.AreEqual(data.DateTime.TimeOfDay.Minutes, target.TimeSpan.Minutes, " [Minutes]");
			Assert.AreEqual(data.DateTime.TimeOfDay.Seconds, target.TimeSpan.Seconds, " [Seconds]");
			Assert.AreEqual(data.ShortTimeString, (string)target, " [Time String]");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void StringConstructorTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target = new Time(data.LongTimeString);
			Assert.AreEqual(DateTime.Now.Date, target.DateTime.Date, " [Date]");
			Assert.AreEqual(data.DateTime.TimeOfDay.Hours, target.TimeSpan.Hours, " [Hours]");
			Assert.AreEqual(data.DateTime.TimeOfDay.Minutes, target.TimeSpan.Minutes, " [Minutes]");
			Assert.AreEqual(data.DateTime.TimeOfDay.Seconds, target.TimeSpan.Seconds, " [Seconds]");
			Assert.AreEqual(data.ShortTimeString, (string)target, " [Time String]");
		}
		#endregion

		#region Public Member Tests
		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeSpanGetPropertyTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target = new Time(data.DateTime);
			Assert.AreEqual(data.TimeSpan, target.TimeSpan);
		}
		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeSpanSetPropertyTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target = new Time("12:00");
			target.TimeSpan = data.TimeSpan;
			Assert.AreEqual(data.TimeSpan, target.TimeSpan);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void DateTimeGetPropertyTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target = new Time(data.DateTime);
			Assert.AreEqual(data.DateTime, target.DateTime);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void DateTimeSetPropertyTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target = new Time("12:00");
			target.DateTime = data.DateTime;
			Assert.AreEqual(data.DateTime, target.DateTime);
		}
		#endregion

		#region Public Override Tests
		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void ToStringTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target = new Time(data.DateTime);
			Assert.AreEqual(data.ShortTimeString, target.ToString());
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void EqualsSameObjectSameValueTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			object target2 = new Time(data.DateTime);
			bool actual = target1.Equals(target2);

			Assert.IsTrue(actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void EqualsSameObjectDifferentValueTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			object target2 = new Time(data.DateTime.AddMinutes(TimeTests.Rnd.Next(1, 59)));
			bool actual = target1.Equals(target2);

			Assert.IsFalse(actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void EqualsDifferentObjectTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			object target2 = 1;
			bool actual = target1.Equals(target2);

			Assert.IsFalse(actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void EqualsNullObjectTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			object target2 = null;
			bool actual = target1.Equals(target2);

			Assert.IsFalse(actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void GetHashCodeTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target = new Time(data.DateTime);
			Assert.AreEqual(data.DateTime.GetHashCode(), target.GetHashCode());
		}
		#endregion

		#region Static Member Tests
		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void ParseTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);
			Time target = Time.Parse(data.LongTimeString);
			Assert.AreEqual(data.ShortTimeString, target.ToString());
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TryParseTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);
			Time result;
			bool actual = Time.TryParse(data.LongTimeString, out result);
			Assert.IsTrue(actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void CanParseTimeStringTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);
			bool actual = Time.CanParse(data.LongTimeString);
			Assert.IsTrue(actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		public void CanParseNonTimeStringTest()
		{
			bool actual = Time.CanParse("Test Data");
			Assert.IsFalse(actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		public void EmptyTest()
		{
			Time target = new Time();
			Assert.AreEqual("12:00 AM", target.ToString());
		}
		#endregion

		#region Implicit Conversion Tests
		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeToStringConversionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);
			Time target = new Time(data.DateTime);
			Assert.AreEqual(data.ShortTimeString, (string)target);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void StringToTimeConversionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);
			Time target = (Time)data.ShortTimeString;
			Assert.AreEqual(data.ShortTimeString, (string)target);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeToDateTimeConversionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);
			Time target = new Time(data.DateTime);
			Assert.AreEqual(data.DateTime, (DateTime)target);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void DateTimeToTimeConversionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);
			Time target = new Time(data.DateTime);
			Assert.AreEqual(target, (Time)data.DateTime);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeToTimeSpanConversionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);
			Time target = new Time(data.TimeSpan);
			Assert.AreEqual(data.TimeSpan, (TimeSpan)target);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeSpanToTimeConversionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);
			Time target = new Time(data.TimeSpan);
			Assert.AreEqual(target, (Time)data.TimeSpan);
		}
		#endregion

		#region Time/Time Operators
		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeAdditionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			Time target2 = new Time(data.DateTime);
			Time target3 = target1 + target2;

			string actual = target3.ToString("H:mm");
			string expected = (target1.TimeSpan + target2.TimeSpan).ToString((@"h\:mm"));

			Assert.AreEqual(expected, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeSubtractionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			Time target2 = new Time(data.DateTime);
			Time target3 = target1 - target2;

			string actual = target3.ToString("H:mm");
			string expected = (target1.TimeSpan - target2.TimeSpan).ToString((@"h\:mm"));

			Assert.AreEqual(expected, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeEqualsTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			Time target2 = new Time(data.DateTime);
			Time target3 = new Time(data.DateTime.AddSeconds(1));

			Assert.IsTrue(target1 == target2, "Target1 == Target2");
			Assert.IsFalse(target1 == target3, "Target1 == Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeNotEqualTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			Time target2 = new Time(data.DateTime.AddSeconds(1));
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 != target2, "Target1 != Target2");
			Assert.IsFalse(target1 != target3, "Target1 != Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeLessThanTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			Time target2 = new Time(data.DateTime.AddSeconds(1));
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 < target2, "Target1 < Target2");
			Assert.IsFalse(target1 < target3, "Target1 < Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeGreaterThanTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime.AddSeconds(1));
			Time target2 = new Time(data.DateTime);
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 > target2, "Target1 > Target2");
			Assert.IsFalse(target2 > target3, "Target2 > Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeLessThanOrEqualToTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			Time target2 = new Time(data.DateTime.AddSeconds(1));
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 <= target2, "Target1 <= Target2");
			Assert.IsTrue(target1 <= target3, "Target1 <= Target3");
			Assert.IsFalse(target2 <= target3, "Target2 <= Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeGreaterThanOrEqualToTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime.AddSeconds(1));
			Time target2 = new Time(data.DateTime);
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 >= target2, "Target1 >= Target2");
			Assert.IsTrue(target2 >= target3, "Target2 >= Target3");
			Assert.IsFalse(target2 >= target1, "Target2 >= Target1");
		}
		#endregion

		#region Time/TimeSpan Operators
		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeSpanAdditionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			TimeSpan target2 = data.TimeSpan;
			Time target3 = target1 + target2;

			string actual = target3.ToString("H:mm");
			string expected = (target1.TimeSpan + target2).ToString((@"h\:mm"));

			Assert.AreEqual(expected, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeSpanSubtractionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			TimeSpan target2 = data.TimeSpan;
			Time target3 = target1 - target2;

			string actual = target3.ToString("H:mm");
			string expected = (target1.TimeSpan - target2).ToString((@"h\:mm"));

			Assert.AreEqual(expected, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeSpanEqualsTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			TimeSpan target2 = data.TimeSpan;
			Time target3 = new Time(data.DateTime.AddSeconds(1));

			Assert.IsTrue(target1 == target2, "Target1 == Target2");
			Assert.IsFalse(target1 == target3, "Target1 == Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeSpanNotEqualTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			TimeSpan target2 = data.TimeSpan.Add(TimeSpan.FromSeconds(1)); ;
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 != target2, "Target1 != Target2");
			Assert.IsFalse(target1 != target3, "Target1 != Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeSpanLessThanTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			TimeSpan target2 = data.TimeSpan.Add(TimeSpan.FromSeconds(1));
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 < target2, "Target1 < Target2");
			Assert.IsFalse(target1 < target3, "Target1 < Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeSpanGreaterThanTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime.AddSeconds(1));
			TimeSpan target2 = data.TimeSpan;
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 > target2, "Target1 > Target2");
			Assert.IsFalse(target2 > target3, "Target2 > Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeSpanLessThanOrEqualToTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			TimeSpan target2 = data.TimeSpan.Add(TimeSpan.FromSeconds(1));
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 <= target2, "Target1 <= Target2");
			Assert.IsTrue(target1 <= target3, "Target1 <= Target3");
			Assert.IsFalse(target2 <= target3, "Target2 <= Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndTimeSpanGreaterThanOrEqualToTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime.AddSeconds(1));
			TimeSpan target2 = data.TimeSpan;
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 >= target2, "Target1 >= Target2");
			Assert.IsTrue(target2 >= target3, "Target2 >= Target3");
			Assert.IsFalse(target2 >= target1, "Target2 >= Target1");
		}
		#endregion

		#region TimeSpan/Time Operators
		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeSpanAndTimeAdditionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			TimeSpan target1 = data.TimeSpan;
			Time target2 = new Time(data.DateTime);
			Time target3 = target1 + target2;

			string actual = target3.ToString("H:mm");
			string expected = (target1 + target2.TimeSpan).ToString((@"h\:mm"));

			Assert.AreEqual(expected, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeSpanAndTimeSubtractionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			TimeSpan target1 = data.TimeSpan;
			Time target2 = new Time(data.DateTime);
			Time target3 = target1 - target2;

			string actual = target3.ToString("H:mm");
			string expected = (target1 - target2.TimeSpan).ToString((@"h\:mm"));

			Assert.AreEqual(expected, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeSpanAndTimeEqualsTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			TimeSpan target1 = data.TimeSpan;
			Time target2 = new Time(data.DateTime);
			Time target3 = new Time(data.DateTime.AddSeconds(1));

			Assert.IsTrue(target1 == target2, "Target1 == Target2");
			Assert.IsFalse(target1 == target3, "Target1 == Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeSpanAndTimeNotEqualTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			TimeSpan target1 = data.TimeSpan;
			Time target2 = new Time(data.DateTime.AddSeconds(1));
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 != target2, "Target1 != Target2");
			Assert.IsFalse(target1 != target3, "Target1 != Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeSpanAndTimeLessThanTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			TimeSpan target1 = data.TimeSpan;
			Time target2 = new Time(data.DateTime.AddSeconds(1));
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 < target2, "Target1 < Target2");
			Assert.IsFalse(target1 < target3, "Target1 < Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeSpanAndTimeGreaterThanTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			TimeSpan target1 = data.TimeSpan.Add(TimeSpan.FromSeconds(1));
			Time target2 = new Time(data.DateTime);
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 > target2, "Target1 > Target2");
			Assert.IsFalse(target2 > target3, "Target2 > Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeSpanAndTimeLessThanOrEqualToTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			TimeSpan target1 = data.TimeSpan;
			Time target2 = new Time(data.DateTime.AddSeconds(1));
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 <= target2, "Target1 <= Target2");
			Assert.IsTrue(target1 <= target3, "Target1 <= Target3");
			Assert.IsFalse(target2 <= target3, "Target2 <= Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeSpanAndTimeGreaterThanOrEqualToTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			TimeSpan target1 = data.TimeSpan.Add(TimeSpan.FromSeconds(1));
			Time target2 = new Time(data.DateTime);
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 >= target2, "Target1 >= Target2");
			Assert.IsTrue(target2 >= target3, "Target2 >= Target3");
			Assert.IsFalse(target2 >= target1, "Target2 >= Target1");
		}
		#endregion

		#region Time/DateTime Operators
		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndDateTimeAdditionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			DateTime target2 = data.DateTime;
			Time target3 = target1 + target2;

			string actual = target3.ToString("H:mm");
			string expected = (target1.TimeSpan + target2.TimeOfDay).ToString((@"h\:mm"));

			Assert.AreEqual(expected, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndDateTimeSubtractionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			DateTime target2 = data.DateTime;
			Time target3 = target1 - target2;

			string actual = target3.ToString("H:mm");
			string expected = (target1.TimeSpan - target2.TimeOfDay).ToString((@"h\:mm"));

			Assert.AreEqual(expected, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndDateTimeEqualsTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			DateTime target2 = data.DateTime;
			Time target3 = new Time(data.DateTime.AddSeconds(1));

			Assert.IsTrue(target1 == target2, "Target1 == Target2");
			Assert.IsFalse(target1 == target3, "Target1 == Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndDateTimeNotEqualTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			DateTime target2 = data.DateTime.AddSeconds(1);
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 != target2, "Target1 != Target2");
			Assert.IsFalse(target1 != target3, "Target1 != Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndDateTimeLessThanTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			DateTime target2 = data.DateTime.AddSeconds(1);
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 < target2, "Target1 < Target2");
			Assert.IsFalse(target1 < target3, "Target1 < Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndDateTimeGreaterThanTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime.AddSeconds(1));
			DateTime target2 = data.DateTime;
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 > target2, "Target1 > Target2");
			Assert.IsFalse(target2 > target3, "Target2 > Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndDateTimeLessThanOrEqualToTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			DateTime target2 = data.DateTime.AddSeconds(1);
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 <= target2, "Target1 <= Target2");
			Assert.IsTrue(target1 <= target3, "Target1 <= Target3");
			Assert.IsFalse(target2 <= target3, "Target2 <= Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void TimeAndDateTimeGreaterThanOrEqualToTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime.AddSeconds(1));
			DateTime target2 = data.DateTime;
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 >= target2, "Target1 >= Target2");
			Assert.IsTrue(target2 >= target3, "Target2 >= Target3");
			Assert.IsFalse(target2 >= target1, "Target2 >= Target1");
		}
		#endregion

		#region DateTime/Time Operators
		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void DateTimeAndTimeAdditionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			DateTime target1 = data.DateTime;
			Time target2 = new Time(data.DateTime);
			Time target3 = target1 + target2;

			string actual = target3.ToString("H:mm");
			string expected = (target1.TimeOfDay + target2.TimeSpan).ToString((@"h\:mm"));

			Assert.AreEqual(expected, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void DateTimeAndTimeSubtractionTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			DateTime target1 = data.DateTime;
			Time target2 = new Time(data.DateTime);
			Time target3 = target1 - target2;

			string actual = target3.ToString("H:mm");
			string expected = (target1.TimeOfDay - target2.TimeSpan).ToString((@"h\:mm"));

			Assert.AreEqual(expected, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void DateTimeAndTimeEqualsTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			DateTime target1 = data.DateTime;
			Time target2 = new Time(data.DateTime);
			Time target3 = new Time(data.DateTime.AddSeconds(1));

			Assert.IsTrue(target1 == target2, "Target1 == Target2");
			Assert.IsFalse(target1 == target3, "Target1 == Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void DateTimeAndTimeNotEqualTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			DateTime target1 = data.DateTime;
			Time target2 = new Time(data.DateTime.AddSeconds(1));
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 != target2, "Target1 != Target2");
			Assert.IsFalse(target1 != target3, "Target1 != Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void DateTimeAndTimeLessThanTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			DateTime target1 = data.DateTime;
			Time target2 = new Time(data.DateTime.AddSeconds(1));
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 < target2, "Target1 < Target2");
			Assert.IsFalse(target1 < target3, "Target1 < Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void DateTimeAndTimeGreaterThanTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			DateTime target1 = data.DateTime.AddSeconds(1);
			Time target2 = new Time(data.DateTime);
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 > target2, "Target1 > Target2");
			Assert.IsFalse(target2 > target3, "Target2 > Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void DateTimeAndTimeLessThanOrEqualToTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			DateTime target1 = data.DateTime;
			Time target2 = new Time(data.DateTime.AddSeconds(1));
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 <= target2, "Target1 <= Target2");
			Assert.IsTrue(target1 <= target3, "Target1 <= Target3");
			Assert.IsFalse(target2 <= target3, "Target2 <= Target3");
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void DateTimeAndTimeGreaterThanOrEqualToTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			DateTime target1 = data.DateTime.AddSeconds(1);
			Time target2 = new Time(data.DateTime);
			Time target3 = new Time(data.DateTime);

			Assert.IsTrue(target1 >= target2, "Target1 >= Target2");
			Assert.IsTrue(target2 >= target3, "Target2 >= Target3");
			Assert.IsFalse(target2 >= target1, "Target2 >= Target1");
		}
		#endregion

		#region Comparable Tests
		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void CompareToSameTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);
			Time target1 = new Time(data.DateTime);
			object target2 = new Time(data.DateTime);
			int actual = target1.CompareTo(target2);
			Assert.AreEqual(0, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void CompareToLessThanTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);
			Time target1 = new Time(data.DateTime.Subtract(TimeSpan.FromSeconds(1)));
			object target2 = new Time(data.DateTime);
			int actual = target1.CompareTo(target2);
			Assert.AreEqual(-1, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void CompareToGreaterThanTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);
			Time target1 = new Time(data.DateTime.AddSeconds(1));
			object target2 = new Time(data.DateTime);
			int actual = target1.CompareTo(target2);
			Assert.AreEqual(1, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		public void CompareToNullTest()
		{
			Time target = new Time("11:15 AM");
			object item = null;
			int actual = target.CompareTo(item);
			Assert.AreEqual(-1, actual);
		}
		#endregion

		#region IFormattable Tests
		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void ToStringFormatTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target = new Time(data.DateTime);
			Assert.AreEqual(data.ShortTimeString, target.ToString("h:mm tt"));
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void ToStringFormatProviderTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			CultureInfo culture = new CultureInfo("fr-FR");
			Time target = new Time(data.DateTime);
			Assert.AreEqual(data.DateTime.ToString("h:mm tt", culture), target.ToString("h:mm tt", culture));
		}
		#endregion

		#region IComparable<Time> Tests
		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void IComparableToSameTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);
			Time target1 = new Time(data.DateTime);
			Time target2 = new Time(data.DateTime);
			int actual = target1.CompareTo(target2);
			Assert.AreEqual(0, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void ICompareToLessThanTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);
			Time target1 = new Time(data.DateTime.Subtract(TimeSpan.FromSeconds(1)));
			Time target2 = new Time(data.DateTime);
			int actual = target1.CompareTo(target2);
			Assert.AreEqual(-1, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void ICompareToGreaterThanTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);
			Time target1 = new Time(data.DateTime.AddSeconds(1));
			Time target2 = new Time(data.DateTime);
			int actual = target1.CompareTo(target2);
			Assert.AreEqual(1, actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[ExpectedException(typeof(FormatException))]
		public void ICompareToNullTest()
		{
			// ***
			// *** Since Time is a structure it cannot be null
			// ***
			Time target = new Time("11:15 AM");
			Time item = null;
			int actual = target.CompareTo(item);
			Assert.AreEqual(-1, actual);
		}
		#endregion

		#region IEquatable<Time> Tests
		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void IEquatableSameValueTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			Time target2 = new Time(data.TimeSpan);
			bool actual = target1.Equals(target2);

			Assert.IsTrue(actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		public void IEquatableDifferentValueTest()
		{
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			Time target2 = new Time(data.DateTime.AddMinutes(TimeTests.Rnd.Next(1, 59)));
			bool actual = target1.Equals(target2);

			Assert.IsFalse(actual);
		}

		[TestMethod]
		[TestCategory("Constructor Tests")]
		[DeploymentItem("TimeTestData.xlsx")]
		[DataSource("System.Data.OleDb", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TimeTestData.xlsx;Extended Properties=\"Excel 12.0;HDR=YES\"", "TimeData$", DataAccessMethod.Sequential)]
		[ExpectedException(typeof(FormatException))]
		public void IEquatableNullObjectTest()
		{
			// ***
			// *** Since Time is a structure it cannot be null
			// ***
			TestDataItem data = TestDataItem.FromDataRow(this.TestContext.DataRow);

			Time target1 = new Time(data.DateTime);
			Time target2 = null;
			bool actual = target1.Equals(target2);

			Assert.IsFalse(actual);
		}
		#endregion
	}
}
